<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fm" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
  <script type="text/javascript" src="webjars/jquery/3.5.1/jquery.min.js"></script>
  	<script type="text/javascript">
  	$(function(){
  		$("table tr:even").css("background","#eff7d1");
  		$("table tr:not(.t-head):odd").css("background","#f7e195");

		$("#insert").click(function(){
			window.location.href = "${pageContext.request.contextPath}/detail/toAdd";
		});
  	});
  	</script>
	  <title></title>
  </head>
  
  <body>
  <h1 align="center">核酸检测系统</h1>
	<div align="center">
		<form action="${pageContext.request.contextPath}/detail/find" method="post">

			<label>
				<select name="name">
					<option value="">请选择</option>
					<option <c:if test="${back eq '河南省人民'}">selected="selected"</c:if> value="河南省人民">河南省人民</option>
					<option <c:if test="${back eq 'u科医院'}">selected="selected"</c:if> value="u科医院">u科医院</option>
					<option <c:if test="${back eq '郑州人民医院'}">selected="selected"</c:if> value="郑州人民医院">郑州人民医院</option>
				</select>
			</label>
			<input type="submit" value="查询">
			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			<a href="${pageContext.request.contextPath}/detail/toAdd">添加</a>

		</form>
	</div>
    <table border="1" align="center" width="800px" cellspacing="0" cellpadding="0">
   			<tr>
   				<td>被检测人</td>
   				<td>被检测人手机号</td>
   				<td>被检测人身份证号</td>
   				<td>检测机构</td>
   				<td>检测日期</td>
                <td>检测结果</td>
                <td>操作</td>
   			</tr>
   			<c:forEach items="${list}" var="l">
   				<tr>
                    <td>${l.assay_user}</td>
                    <td>${l.phone}</td>
                    <td>${l.card_num}</td>
   					<td>${l.name}</td>
   					<td><fm:formatDate value="${l.assay_time}" pattern="yyyy-MM-dd"></fm:formatDate></td>
                    <td>
                        <c:if test="${l.assay_result==0}">检测中</c:if>
                        <c:if test="${l.assay_result==1}">确诊</c:if>
                    </td>
                    <td><a href="${pageContext.request.contextPath}/detail/update/${l.id}">确诊</a></td>
   				</tr>
   			</c:forEach>
   		</table>
  </body>
</html>
